import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  // createWebHashHistory
  // vite中的环境变量 import.meta.env.BASE_URL vite.config.js中的base配置项
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {path:'/login',component:()=>import('@/views/login/LoginPage.vue')},
    {path:'/',redirect:'/idea',
      component:()=>import('@/views/layout/LayoutContainer.vue'),
      children:[
        {path:'/idea',component:()=>import('@/views/idea/IdeaPage.vue')},
        {path:'/topicManage',component:()=>import('@/views/topic/TopicManage.vue')},
        {path:'/AIQuestion',component:()=>import('@/views/topic/AIQuestion.vue')},
        {path:'/basicInfo',component:()=>import('@/views/user/BasicInfo.vue')},
        {path:'/changeAvatar',component:()=>import('@/views/user/ChangeAvatar.vue')},
        {path:'/resetPassw',component:()=>import('@/views/user/ResetPassw.vue')},
      ]
    },
  ],
})

export default router
